﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tanmia.Core;
using FluentNHibernate.Mapping;

namespace Tanmia.NHibernate.Mapping
{
    public class StockMovementMap : ClassMap<StockMovement>
    {
        public StockMovementMap()
        {
            Table("StockMovement");

            Id(x => x.StockMovementID).Not.Nullable().GeneratedBy.Identity();

            Map(x => x.Quantity).Not.Nullable().Default("0");
            Map(x => x.Sacle).Not.Nullable();
            Map(x => x.Part).Not.Nullable();
            Map(x => x.UnitName).Not.Nullable().Length(128);
            Map(x => x.UnitPrice).Not.Nullable();
            //Map(x => x.Total).Not.Nullable();
            Map(x => x.Note).Nullable().Length(2048);

            References(x => x.Item, "DiscriminatedItemID").Not.Nullable();
        }
    }
}
